/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.mallsite.modules.shop.entity;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.entity.TreeEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 商品分类Entity
 * @author ruyang
 * @version 2020-12-04
 */
@Table(name="ms_goods_category", alias="a", columns={
		@Column(name="category_code", attrName="categoryCode", label="分类编码", isPK=true),
		@Column(includeEntity=TreeEntity.class),
		@Column(name="shop_id", attrName="shopId", label="店铺编码"),
		@Column(name="category_logo", attrName="categoryLogo", label="分类图片"),
		@Column(name="category_cover", attrName="categoryCover", label="分类封面"),
		@Column(name="category_name", attrName="categoryName", label="分类名称", queryType=QueryType.LIKE, isTreeName=true),
		@Column(name="summary", attrName="summary", label="摘要"),
		@Column(name="content", attrName="content", label="分类说明"),
		@Column(name="category_recommend", attrName="categoryRecommend", label="类型推荐"),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.tree_sorts, a.category_code"
)
public class GoodsCategory extends TreeEntity<GoodsCategory> {
	
	private static final long serialVersionUID = 1L;
	private String categoryCode;		// 分类编码
	private String shopId;		// 店铺编码
	private String categoryLogo;		// 分类图片
	private String categoryCover;		// 分类封面
	private String categoryName;		// 分类名称
	private String summary;		// 摘要
	private String content;		// 分类说明
	private String categoryRecommend;		// 类型推荐
	
	public GoodsCategory() {
		this(null);
	}

	public GoodsCategory(String id){
		super(id);
	}
	
	@Override
	public GoodsCategory getParent() {
		return parent;
	}

	@Override
	public void setParent(GoodsCategory parent) {
		this.parent = parent;
	}
	
	public String getCategoryCode() {
		return categoryCode;
	}

	public void setCategoryCode(String categoryCode) {
		this.categoryCode = categoryCode;
	}
	
	public String getShopId() {
		return shopId;
	}

	public void setShopId(String shopId) {
		this.shopId = shopId;
	}
	
	public String getCategoryLogo() {
		return categoryLogo;
	}

	public void setCategoryLogo(String categoryLogo) {
		this.categoryLogo = categoryLogo;
	}
	
	public String getCategoryCover() {
		return categoryCover;
	}

	public void setCategoryCover(String categoryCover) {
		this.categoryCover = categoryCover;
	}
	
	@NotBlank(message="分类名称不能为空")
	public String getCategoryName() {
		return categoryName;
	}

	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}
	
	public String getSummary() {
		return summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}
	
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	public String getCategoryRecommend() {
		return categoryRecommend;
	}

	public void setCategoryRecommend(String categoryRecommend) {
		this.categoryRecommend = categoryRecommend;
	}
	
}